<template>
  <NuxtLayout name="account">
    <el-tabs v-model="examType" @tab-click="handleTabClick">
      <el-tab-pane v-for="(item, index) in tabPanes" :key="index" :label="item.label" :name="item.type">
        <account-exam-list v-if="examType === item.type" :exam-type="examType" />
      </el-tab-pane>
    </el-tabs>
  </NuxtLayout>
</template>
<script setup>
  const examType = ref(0)
  function handleTabClick(tab) {
    examType.value = tab.props.name
  }
  const tabPanes = [
    {
      label: '所有考试',
      type: 0
    },
    {
      label: '模拟考试',
      type: 1
    },
    {
      label: '正式考试',
      type: 2
    }
  ]
</script>
<style lang="scss" scoped></style>
